refactor: extract latest-leaf named backups facade#301
refactor: extract latest-leaf named backups facade#301ndycode wants to merge 1 commit intorefactor/pr3-storage-save-flagged-entryfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary
getNamedBackupsfacade out oflib/storage.tson top of the latest storage leafValidation
npm run typechecknpm run lint -- lib/storage/named-backups-entry.ts lib/storage.ts test/named-backups-entry.test.tsnpm run test -- test/named-backups-entry.test.tsnote: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this pr extracts the
getNamedBackupswiring out oflib/storage.tsinto a newlib/storage/named-backups-entry.tsfacade, following the same leaf-entry DI pattern used byrestoreAccountsFromBackupEntryand siblings. behavior is unchanged;storage.tsslims down by delegating to the new helper.lib/storage/named-backups-entry.ts: thin facade accepting injectedgetStoragePath,collectNamedBackups,loadAccountsFromPath, andlogDebug— all forwarded directly tocollectNamedBackups, no logic addedlib/storage.ts:getNamedBackupsnow delegates togetNamedBackupsEntry; the call-site wiring is identical to the pre-refactor inline calltest/named-backups-entry.test.ts: single focused vitest case asserting the wiring — happy path only; non-empty result passthrough is unexercisednamed-backups-entry.tsimportsNamedBackupSummaryfrom../storage.jsrather than from./named-backups.jswhere it is actually defined, creating a type-level cycle in the module graph; harmless at runtime but worth fixinglib/AGENTS.md/lib/storagedirectory listing not updated to include the new file — minor maintenance gapConfidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant caller as caller participant storage as lib/storage.ts<br/>getNamedBackups() participant entry as lib/storage/named-backups-entry.ts<br/>getNamedBackupsEntry() participant collector as lib/storage/named-backups.ts<br/>collectNamedBackups() caller->>storage: getNamedBackups() storage->>entry: getNamedBackupsEntry({ getStoragePath, collectNamedBackups, loadAccountsFromPath, logDebug }) entry->>entry: params.getStoragePath() entry->>collector: collectNamedBackups(storagePath, { loadAccountsFromPath, logDebug }) collector-->>entry: NamedBackupSummary[] entry-->>storage: NamedBackupSummary[] storage-->>caller: NamedBackupSummary[]Prompt To Fix All With AI
Last reviewed commit: "refactor: extract la..."